package com.newcapec.lesson2;

public class Demo1 extends Object{
    {

    }
    public static void main(String[] args) {
        {
            /*Student student1 = new Student();
            Student student2 = new Student(111);
            Student student3 = new Student(222);
            Student student4 = new Student(333);*/
 /*           for(int i = 1; i <= 100*100*100; i++){
                Student student = new Student(i);
            }*/
            //System.out.println(Student.count);
            //System.out.println(student1.getObjNumber());
        }

        for(int i = 1; i <= 100*100*100; i++){
            Student student = new Student(i);
        }




        //System.gc();
        System.out.println(Student.count);
        System.out.println("---------------------");

        //jvm回收垃圾内存
        //垃圾内存--当堆中的这块区域没有引用指向的时候，会被jvm标记为垃圾内存,等待被jvm回收
    }
}
